﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterALSafa.Master" AutoEventWireup="true"
    CodeBehind="TeacherComments.aspx.cs" Inherits="School.Pages.Admission.TeacherComments" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server">
        <ProgressTemplate>
            <div id="displaybox">
                <div>
                    جارى تنفيذ الأمر</div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div align="center">
                <asp:Panel ID="pnlbrows" runat="server" Visible="true">
                    <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                        <tr>
                            <td>
                                <table width="100%">
                                    <tr>
                                        <td style="width: 50%">
                                            <table width="100%">
                                                <tr>
                                                    <td width="40%">
                                                        المجمع
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="LstCampuses" runat="server" AutoPostBack="True" OnSelectedIndexChanged="LstCampuses_SelectedIndexChanged">
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        الشهادة
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="LstCertificates" runat="server" AutoPostBack="True" OnSelectedIndexChanged="LstCertificates_SelectedIndexChanged">
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        المرحلة
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="LstStages" runat="server" AutoPostBack="True" OnSelectedIndexChanged="LstStages_SelectedIndexChanged">
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        الصف
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="LstGrades" runat="server" AutoPostBack="True" OnSelectedIndexChanged="LstGrades_SelectedIndexChanged">
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        الطالب
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList ID="LstStudents" runat="server" AutoPostBack="True" OnSelectedIndexChanged="LstStudents_SelectedIndexChanged">
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td>
                                            <table>
                                                <tr>
                                                    <td>
                                                        اسم الطالب
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="TxtStudentName" runat="server"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        أو رقم الطالب
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="TxtStudentNumber" runat="server"></asp:TextBox>                                                    
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <asp:Button ID="BtnSearch" runat="server" Text="بحث" OnClick="BtnSearch_Click" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                        <td>
                        
                        </td>
                        </tr> 
                         <tr>
                            <td colspan="2">
                                <asp:Panel CssClass="students_search_grid" ID="StudentsPanel" runat="server" Visible="false">
                                    <h2>
                                        الطلاب</h2>
                                    <asp:GridView ID="StudentsGrid" runat="server" Width="100%" CssClass="Grid" HeaderStyle-CssClass="GridHeaderFooter"
                                        FooterStyle-CssClass="GridHeaderFooter" PagerStyle-CssClass="GridPager" AlternatingRowStyle-CssClass="GridItemAltername"
                                        AutoGenerateColumns="False" Visible="False" 
                                        onrowcommand="StudentsGrid_RowCommand">
                                        <AlternatingRowStyle CssClass="GridItemAltername" />
                                        <Columns>
                                            <asp:BoundField DataField="StudentNumber" HeaderText="رقم الطالب" />
                                            <asp:BoundField DataField="StudentName" HeaderText="اسم الطالب" />
                                            <asp:BoundField DataField="Certificate" HeaderText="القسم" />
                                            <asp:BoundField DataField="Grade" HeaderText="الصف" />
                                            <asp:TemplateField Visible="False">
                                                <ItemTemplate>
                                                    <asp:Label ID="LblStudentId" runat="server" Text='<%# Eval("Id") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:ButtonField ButtonType="Button" Text="اختيار" CommandName="Select" />
                                        </Columns>
                                        <FooterStyle CssClass="GridHeaderFooter" />
                                        <HeaderStyle CssClass="GridHeaderFooter" />
                                        <PagerStyle CssClass="GridPager" />
                                    </asp:GridView>
                                    <asp:Label Font-Size="Larger" ID="LblSearchNotFound" runat="server" Text="لم يتم العثور على الطالب"
                                        ForeColor="Red" Visible="false"></asp:Label>
                                </asp:Panel>
                                <asp:HiddenField ID="HfStudentId" runat="server" OnValueChanged="HfStudentId_ValueChanged" />
                                <asp:HiddenField ID="hfCommentId" runat="server" />
                            </td>
                        </tr>                        
                        <tr> 
                        <td colspan="2" >
                        <table width="100%" >
                        <tr>
                        <td width="20%">اسم الطالب</td>
                        <td width="80%" align="right">
                       <asp:Label ID="lblStudentName" runat="server" ></asp:Label>
                       </td>
                        </tr>
                        <tr>
                        <td width="20%">الملاحظة</td>
                        <td width="80%">
                        <asp:TextBox ID="txtComment" runat="server" TextMode="MultiLine" Width="100%" Height="100px" ></asp:TextBox>
                        </td>
                        </tr>
                         <tr>
                        <td width="20%">&nbsp;</td>
                        <td width="80%" align="right">
                        <asp:CheckBox ID="chViewOnSite" runat="server" Text="اظهار على الموقع" />
                        </td>
                        </tr>
                        </table>
                        </td>
                        </tr>
                         
                        <tr>
                            <td colspan="4">
                                <asp:Button ID="btnAdd" runat="server" CssClass="graybutton" 
                                    Text="اضافة الملاحظة" onclick="btnAdd_Click" />
                                &nbsp;&nbsp;<asp:Button ID="btnCancel" runat="server" CssClass="graybutton" 
                                    Text="الغاء" onclick="btnCancel_Click" />
                            </td>
                        </tr>
                       
                        <tr>
                            <td colspan="4" style="text-align: right">
                                <asp:Label ID="lblRecordNo" runat="server" CssClass="admintitle"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4">
                                <asp:GridView ID="griddata" runat="server" AllowPaging="True" AllowSorting="True"
                                    AlternatingRowStyle-CssClass="GridItemAltername" AutoGenerateColumns="False"
                                    CssClass="Grid"  FooterStyle-CssClass="GridHeaderFooter" HeaderStyle-CssClass="GridHeaderFooter"
                                    PagerStyle-CssClass="GridPager" Width="100%" PageSize="20" onpageindexchanging="griddata_PageIndexChanging" 
                                    >
                                    <AlternatingRowStyle CssClass="GridItemAltername" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="الاسم الكامل">
                                            <ItemTemplate>
                                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("FullName").ToString()%>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>                                                                               
                                        <asp:TemplateField ShowHeader="False" HeaderText="اظهار">
                                            <ItemTemplate>
                                           <asp:CheckBox ID="chView" runat="server" Checked= '<%# Eval("ViewOnSite") %>' Enabled="false"  />                                             
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="Comment" HeaderText="الملاحظة" />
                                        <asp:TemplateField ShowHeader="False">
                                            <ItemTemplate>
                                           
                                                <asp:LinkButton ID="lnkUpdate" runat="server" CausesValidation="False" 
                                                    Text="تعديل" CommandArgument='<%# Eval("CommentId") %>' onclick="lnkUpdate_Click"></asp:LinkButton>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <FooterStyle CssClass="GridHeaderFooter" />
                                    <HeaderStyle CssClass="GridHeaderFooter" />
                                    <PagerStyle CssClass="GridPager" />
                                </asp:GridView>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </div>
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
